package chapter01

object Test13_IF2 {
  def main(args: Array[String]): Unit = {
    val age = scala.io.StdIn.readInt()
    //多分支 if else if else
    //根据输入的年龄判读状态
    val result = if (age<=0){
        "错入输入"
    } else if(age <= 10) {
      "儿童"
    } else if (age <= 20) {
      "少年"
    } else if (age <= 30) {
      "青年"
    } else if (age <= 40) {
      "中年"
    } else if (age <= 50) {
      "中老年"
    } else if (age <= 70) {
      "老年"
    } else {
      "晚年"
    }
    println(result)
  }
}
